.class Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;
.super Landroid/graphics/drawable/Drawable;
.source "LatinKeyboard.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/inputmethod/latin/LatinKeyboard;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "SlidingLocaleDrawable"
.end annotation


# instance fields
.field private mAscent:I

.field private mBackground:Landroid/graphics/drawable/Drawable;

.field private mCurrentLanguage:Ljava/lang/String;

.field private mDiff:I

.field private mHeight:I

.field private mHitThreshold:Z

.field private mLeftDrawable:Landroid/graphics/drawable/Drawable;

.field private mMiddleX:I

.field private mNextLanguage:Ljava/lang/String;

.field private mPrevLanguage:Ljava/lang/String;

.field private mRightDrawable:Landroid/graphics/drawable/Drawable;

.field private mTextPaint:Landroid/text/TextPaint;

.field private mThreshold:I

.field private mWidth:I

.field final synthetic this$0:Lcom/android/inputmethod/latin/LatinKeyboard;


# direct methods
.method public constructor <init>(Lcom/android/inputmethod/latin/LatinKeyboard;Landroid/graphics/drawable/Drawable;II)V
    .locals 6
    .parameter
    .parameter "background"
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v5, 0x0

    .line 688
    iput-object p1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->this$0:Lcom/android/inputmethod/latin/LatinKeyboard;

    invoke-direct {p0}, Landroid/graphics/drawable/Drawable;-><init>()V

    .line 689
    iput-object p2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mBackground:Landroid/graphics/drawable/Drawable;

    .line 690
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mBackground:Landroid/graphics/drawable/Drawable;

    iget-object v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mBackground:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v2}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v2

    iget-object v3, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mBackground:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v3

    invoke-virtual {v1, v5, v5, v2, v3}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 692
    iput p3, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    .line 693
    iput p4, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mHeight:I

    .line 694
    new-instance v1, Landroid/text/TextPaint;

    invoke-direct {v1}, Landroid/text/TextPaint;-><init>()V

    iput-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    .line 695
    const v1, 0x1030044

    const/16 v2, 0x12

    invoke-static {p1, v1, v2}, Lcom/android/inputmethod/latin/LatinKeyboard;->access$000(Lcom/android/inputmethod/latin/LatinKeyboard;II)I

    move-result v0

    .line 696
    .local v0, textSize:I
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    int-to-float v2, v0

    invoke-virtual {v1, v2}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 697
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    invoke-virtual {v1, v5}, Landroid/text/TextPaint;->setColor(I)V

    .line 698
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    sget-object v2, Landroid/graphics/Paint$Align;->CENTER:Landroid/graphics/Paint$Align;

    invoke-virtual {v1, v2}, Landroid/text/TextPaint;->setTextAlign(Landroid/graphics/Paint$Align;)V

    .line 699
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    const/16 v2, 0xff

    invoke-virtual {v1, v2}, Landroid/text/TextPaint;->setAlpha(I)V

    .line 700
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Landroid/text/TextPaint;->setAntiAlias(Z)V

    .line 701
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    invoke-virtual {v1}, Landroid/text/TextPaint;->ascent()F

    move-result v1

    float-to-int v1, v1

    iput v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mAscent:I

    .line 702
    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    iget-object v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mBackground:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v2}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v2

    sub-int/2addr v1, v2

    div-int/lit8 v1, v1, 0x2

    iput v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mMiddleX:I

    .line 703
    invoke-static {p1}, Lcom/android/inputmethod/latin/LatinKeyboard;->access$100(Lcom/android/inputmethod/latin/LatinKeyboard;)Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f020057

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    iput-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mLeftDrawable:Landroid/graphics/drawable/Drawable;

    .line 705
    invoke-static {p1}, Lcom/android/inputmethod/latin/LatinKeyboard;->access$100(Lcom/android/inputmethod/latin/LatinKeyboard;)Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f020058

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    iput-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mRightDrawable:Landroid/graphics/drawable/Drawable;

    .line 707
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mLeftDrawable:Landroid/graphics/drawable/Drawable;

    iget-object v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mLeftDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v2}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v2

    iget-object v3, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mLeftDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v3

    invoke-virtual {v1, v5, v5, v2, v3}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 709
    iget-object v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mRightDrawable:Landroid/graphics/drawable/Drawable;

    iget v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    iget-object v3, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mRightDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v3

    sub-int/2addr v2, v3

    iget v3, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    iget-object v4, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mRightDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v4}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v4

    invoke-virtual {v1, v2, v5, v3, v4}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 711
    invoke-static {p1}, Lcom/android/inputmethod/latin/LatinKeyboard;->access$200(Lcom/android/inputmethod/latin/LatinKeyboard;)Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;

    move-result-object v1

    invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I

    move-result v1

    iput v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mThreshold:I

    .line 712
    return-void
.end method


# virtual methods
.method public draw(Landroid/graphics/Canvas;)V
    .locals 4
    .parameter "canvas"

    .prologue
    const/4 v2, 0x0

    .line 729
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 730
    iget-boolean v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mHitThreshold:Z

    if-eqz v0, :cond_1

    .line 731
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    const/4 v1, -0x1

    invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V

    .line 732
    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mHeight:I

    invoke-virtual {p1, v2, v2, v0, v1}, Landroid/graphics/Canvas;->clipRect(IIII)Z

    .line 733
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mCurrentLanguage:Ljava/lang/String;

    if-nez v0, :cond_0

    .line 734
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->this$0:Lcom/android/inputmethod/latin/LatinKeyboard;

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    iget-object v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    invoke-static {v0, v1, v2}, Lcom/android/inputmethod/latin/LatinKeyboard;->access$300(Lcom/android/inputmethod/latin/LatinKeyboard;ILandroid/graphics/Paint;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mCurrentLanguage:Ljava/lang/String;

    .line 735
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->this$0:Lcom/android/inputmethod/latin/LatinKeyboard;

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    iget-object v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    invoke-static {v0, v1, v2}, Lcom/android/inputmethod/latin/LatinKeyboard;->access$400(Lcom/android/inputmethod/latin/LatinKeyboard;ILandroid/graphics/Paint;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mNextLanguage:Ljava/lang/String;

    .line 736
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->this$0:Lcom/android/inputmethod/latin/LatinKeyboard;

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    iget-object v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    invoke-static {v0, v1, v2}, Lcom/android/inputmethod/latin/LatinKeyboard;->access$500(Lcom/android/inputmethod/latin/LatinKeyboard;ILandroid/graphics/Paint;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mPrevLanguage:Ljava/lang/String;

    .line 738
    :cond_0
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mCurrentLanguage:Ljava/lang/String;

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    div-int/lit8 v1, v1, 0x2

    iget v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    add-int/2addr v1, v2

    int-to-float v1, v1

    iget v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mAscent:I

    neg-int v2, v2

    add-int/lit8 v2, v2, 0x4

    int-to-float v2, v2

    iget-object v3, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 740
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mNextLanguage:Ljava/lang/String;

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    iget v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    div-int/lit8 v2, v2, 0x2

    sub-int/2addr v1, v2

    int-to-float v1, v1

    iget v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mAscent:I

    neg-int v2, v2

    add-int/lit8 v2, v2, 0x4

    int-to-float v2, v2

    iget-object v3, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 742
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mPrevLanguage:Ljava/lang/String;

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    iget v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    add-int/2addr v1, v2

    iget v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    div-int/lit8 v2, v2, 0x2

    add-int/2addr v1, v2

    int-to-float v1, v1

    iget v2, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mAscent:I

    neg-int v2, v2

    add-int/lit8 v2, v2, 0x4

    int-to-float v2, v2

    iget-object v3, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mTextPaint:Landroid/text/TextPaint;

    invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 744
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mLeftDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 745
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mRightDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 747
    :cond_1
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mBackground:Landroid/graphics/drawable/Drawable;

    if-eqz v0, :cond_2

    .line 748
    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mMiddleX:I

    int-to-float v0, v0

    const/4 v1, 0x0

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->translate(FF)V

    .line 749
    iget-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mBackground:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 751
    :cond_2
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 752
    return-void
.end method

.method public getIntrinsicHeight()I
    .locals 1

    .prologue
    .line 776
    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mHeight:I

    return v0
.end method

.method public getIntrinsicWidth()I
    .locals 1

    .prologue
    .line 771
    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    return v0
.end method

.method public getOpacity()I
    .locals 1

    .prologue
    .line 756
    const/4 v0, -0x3

    return v0
.end method

.method public setAlpha(I)V
    .locals 0
    .parameter "alpha"

    .prologue
    .line 762
    return-void
.end method

.method public setColorFilter(Landroid/graphics/ColorFilter;)V
    .locals 0
    .parameter "cf"

    .prologue
    .line 767
    return-void
.end method

.method setDiff(I)V
    .locals 2
    .parameter "diff"

    .prologue
    .line 715
    const v0, 0x7fffffff

    if-ne p1, v0, :cond_0

    .line 716
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mHitThreshold:Z

    .line 717
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mCurrentLanguage:Ljava/lang/String;

    .line 725
    :goto_0
    return-void

    .line 720
    :cond_0
    iput p1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    .line 721
    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    if-le v0, v1, :cond_1

    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    iput v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    .line 722
    :cond_1
    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    neg-int v1, v1

    if-ge v0, v1, :cond_2

    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mWidth:I

    neg-int v0, v0

    iput v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    .line 723
    :cond_2
    iget v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mDiff:I

    invoke-static {v0}, Ljava/lang/Math;->abs(I)I

    move-result v0

    iget v1, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mThreshold:I

    if-le v0, v1, :cond_3

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->mHitThreshold:Z

    .line 724
    :cond_3
    invoke-virtual {p0}, Lcom/android/inputmethod/latin/LatinKeyboard$SlidingLocaleDrawable;->invalidateSelf()V

    goto :goto_0
.end method
